home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / JForth / Extras / ODE / obj_stack_class < prev    next >
Encoding:
Text File  |  1991-10-24  |  358 b   |  26 lines

  1. \ Define STACK class.
  2. \
  3. \ Author: Phil Burk
  4. \ Copyright 1986 Delta Research
  5.  
  6. ANEW TASK-OBJ_STACK_CLASS
  7.  
  8. METHOD PUSH:   METHOD POP:
  9. :CLASS OB.STACK  <SUPER OB.LIST
  10.  
  11. :M PUSH: ( value -- )
  12.     add: self
  13. ;M
  14.  
  15. :M POP: ( -- value )
  16.     many: self 0>
  17.     IF last: self
  18.         -1 iv+> iv-many
  19.     ELSE
  20.         " POP: OB.STACK" " Stack underflow"
  21.         er_fatal ob.report.error
  22.     THEN
  23. ;M
  24.  
  25. ;CLASS
  26.